﻿// -------------------------------------------------------------------------
//    @FileName         :    NFQuestUtil.h
//    @Author           :    gaoyi
//    @Date             :    2025/1/15
//    @Email            :    445267987@qq.com
//    @Module           :    NFQuestUtil
//
// -------------------------------------------------------------------------

#pragma once

#include <E_LoopQuest.nanopb.h>
#include <E_Quest.nanopb.h>

class NFPlayer;
class NFQuestPart;

class NFQuestUtil
{
public:
    static int CheckAcceptNormal(NFQuestPart* pQuestPart, const E_Quest* pDesc, bool bNotCheckFinish = false);
    static int CheckAcceptRound(NFQuestPart* pQuestPart, const LoopQuest* pLoop, const E_Quest* pDesc, bool bNotCheckTeam = false);

public:
    static int CheckAcceptCommon(NFQuestPart* pQuestPart, const E_Quest* pDesc, bool bNotCheckTeam = false);
    static int CheckAcceptCommon(NFQuestPart* pQuestPart, const E_LoopQuest* pDesc, bool bNotCheckTeam = false);
    static int CheckAcceptAfterFinish(int iPrev, int iNext, NFQuestPart* pQuestPart);

public:
    static int InitQuestNode(NFPlayer* pPlayer, QuestNode* pNode, const E_Quest* pDesc);

public:
    static int CheckTeam(NFPlayer* pPlayer, int iQuestId, int iMemberNum, int iLevelMin, int iLevelMax, bool inGuild);

public:
    static int CalcQuestExpMoney(NFPlayer* pPlayer, const E_Quest* pDesc, double& exp, double& money, double& pet_exp, double& nian, double& contri, double& coin, double& bonus);
    static double CalcQuestAward(int funId, int param1, int param2, int time, int playerLevel);
    static double CalcQuestAward(int funId, float param1, float param2, int time, int playerLevel);
    static double CalcNianAward(int funId, float param1, float param2, int time, int playerLevel);
public:
    static int OnQuestComplete(NFPlayer* pPlayer, int iQuestId);
};
